import {
  request,
  METHOD
} from '@/utils/request'
// import axios from 'axios'

// import Cookie from 'js-cookie'
const BASE_URL = process.env.VUE_APP_API_URL
// 车辆品牌 下拉框
export async function brandsGet () {
  return request(`${BASE_URL}/business/admin/brands/allByVehicle`, METHOD.GET)
}
// 品牌 下拉框
export async function brandAllGet (data) {
  return request(`${BASE_URL}/business/admin/brands/listNoPage`, METHOD.GET, data)
}
// 换电品牌 下拉框
export async function brandsBatteryGet () {
  return request(`${BASE_URL}/business/admin/brands/allByBattery`, METHOD.GET)
}
// 型号下拉框
export async function modelGet (brandId) {
  return request(`${BASE_URL}/business/admin/vehicleModels/findAllByBrandId`, METHOD.GET, {
    brandId: brandId
  })
}
// 新增入库车辆
export async function createPutInStorage (params) {
  return request(`${BASE_URL}/business/admin/putInStorageVehicleInfo/create`, METHOD.POST, params)
}
// 编辑入库车辆
export async function updatePutInStorage (params) {
  return request(`${BASE_URL}/business/admin/putInStorageVehicleInfo/update`, METHOD.POST, params)
}
// 编辑回显
export async function foreditPutInStorage (id) {
  return request(`${BASE_URL}/business/admin/putInStorageVehicleInfo/foredit/${id}`, METHOD.GET)
}

export async function changeStore (params) {
  return request(`${BASE_URL}/business/admin/vehicleSchedule/changeStore`, METHOD.POST, params)
}
// 自有车辆修改车辆信息
export async function updateDeviceNoAndVehicleLeaseType (id, params) {
  return request(`${BASE_URL}/business/admin/vehicles/updateDeviceNoAndVehicleLeaseType/${id}`, METHOD.PUT, params)
}
// 非自有车辆修改车辆信息
export async function noQQupdateDeviceNoAndVehicleLeaseType (id, params) {
  return request(`${BASE_URL}/business/admin/vehicles/merchant/updateDeviceNoAndVehicleLeaseType/${id}`, METHOD.PUT, params)
}

// 1.6.5 车辆-车辆管理-骑圈自有车辆-详情-修改车辆状态
export async function selfChangeStatus (params) {
  return request(`${BASE_URL}/business/admin/vehicleMember/changeStatus`, METHOD.POST, params)
}
// 1.6.5 车辆-车辆管理-商户自有车辆-详情-修改车辆状态
export async function storeChangeStatus (params) {
  return request(`${BASE_URL}/business/admin/vehicleMember/merchant/changeStatus`, METHOD.POST, params)
}
